package demo.spring.demo1;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.FileSystemResource;

/**
 * description: <br>
 * createTime: 2020/9/2818:04 <br>
 *
 * @author zzh
 */
public class Main {

    public static void main(String[] args) {
        ApplicationContext app = new ClassPathXmlApplicationContext("classpath:demo/spring/demo1/spring.xml");

        FruitPlate fp1= (FruitPlate)app.getBean("fruitPlate1");
        FruitPlate fp2 = (FruitPlate)app.getBean("fruitPlate2");
        System.out.println(fp1.getClass().getName());
        System.out.println(fp2.getClass().getName());
        fp1.getFruit();
        fp1.getFruit();
        fp2.getFruit();
        fp2.getFruit();
    }
}
